<!DOCTYPE html>
<html>
    <head>
        <meta name="layout" content="main2" />
        <g:set var="entityName" value="${message(code: 'subscribe.label', default: 'subscribe')}" />
        <r:require module="export" />
        <title>消息</title>
    </head>
    <body>
      <div class="main-body">
          <div class="page-wrapper">
              <!-- Page-header start -->
              <div class="page-header">
                  <div class="page-header-title">
                      <h4>消息列表</h4>
                  </div>

                  <div class="page-header-breadcrumb">
                      <ul class="breadcrumb-title">
                          <li class="breadcrumb-item">
                              <a href="/salesDashboard/index">
                                  <i class="icofont icofont-home"></i>
                              </a>
                          </li>
                          <li class="breadcrumb-item"><a href="#!">消息列表</a>
                          </li>
                      </ul>
                  </div>
              </div>
              <!-- Page-header end -->
              <!-- Page-body start -->
              <div class="page-body">
                  <!-- Hover table card start -->
                  <div class="card">
                      <div class="card-header">
                          <h5>消息列表</h5>

                          <div class="card-header-right">
                              %{-- <i class="icofont icofont-rounded-down"></i> --}%
                              <g:link action="create"><i class="ion-plus"></i> 新增</g:link>
                          </div>
                      </div>

                      <div class="card-block dt-responsive">

                          <div class="table-responsive">
                              <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">

                                  <g:form method="POST" action="searchSubscribe">
                                      <div class="row m-0">
                                          <div class="col-md-8 p-l-0">
                                              <div id="order-table_filter" class="dataTables_filter text-left">
                                                  <label>搜索
                                                      <input type="text" class="form-control" placeholder="主题" name="subject" id="subject" value="${params?.subject}">
                                                  </label>
                                              </div>
                                          </div>

                                          <div class="col-md-4 p-r-0 dt-buttons text-right">
                                              <button class="btn btn-inverse btn-sm btn-squeare" type="submit"><i class="fa fa-search"></i></button>
                                              <button class="btn btn-inverse btn-sm btn-squeare" type="button" id="resetBtn"><i class="fa fa-refresh"></i></button>
                                          </div>
                                      </div>
                                  </g:form>

                                  <table class="table table-striped  table-bordered table-hover">
                                      <thead>
                                          <tr>
                                              <g:sortableColumn property="subject" title="${message(code: 'subscribe.subject.label', default: '主题')}"></g:sortableColumn>
                                              <g:sortableColumn property="source" title="${message(code: 'subscribe.source.label', default: '用户')}"></g:sortableColumn>
                                              <!-- <g:sortableColumn property="link" title="${message(code: 'subscribe.link.label', default: '链接')}"></g:sortableColumn> -->
                                              <g:sortableColumn property="tag" title="${message(code: 'subscribe.tag.label', default: '标签')}"></g:sortableColumn>
                                              <g:sortableColumn property="createDate" title="${message(code: 'subscribe.createDate.label', default: '创建时间')}"></g:sortableColumn>
                                          </tr>
                                      </thead>
                                      <tbody>
                                          <g:each in="${subscribeList}">
                                              <tr>
                                                  <td>
                                                      <a href="${it?.link}">${it?.subject}</a>
                                                  </td>
                                                  <!-- <td>${it?.link}</td> -->
                                                  <td>${it?.source}</td>
                                                  <td>${it?.tag}</td>

                                                  <td>
                                                      <g:formatDate format="yyyy-MM-dd HH:mm:ss" date="${it?.createDate}" />
                                                  </td>

                                              </tr>
                                          </g:each>
                                      </tbody>
                                  </table>

                                  <div class="dataTables_paginate">
                                      <div class="pagination">
                                          <g:paginate total="${subscribeCount ?: 0}" params="${params}" />
                                      </div>
                                  </div>
                              </div>

                          </div>

                      </div>
                  </div>
              </div>
          </div>
      </div>
      <g:javascript>
          $(function() {
              $("#resetBtn").click(function() {
                  $("#subject").val("");
              })
          });
      </g:javascript>
    </body>
</html>
